package com.qfedu.openplateform.warehouse.service.impl;

import com.qfedu.openplateform.common.entity.WarehouseProduct;
import com.qfedu.openplateform.warehouse.dao.WareMapper;
import com.qfedu.openplateform.warehouse.service.WareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WareServiceImpl implements WareService {
    @Autowired
    private WareMapper wareMapper;

    @Override
    public List<WarehouseProduct> checkAllWare() {
        List<WarehouseProduct> productList = wareMapper.checkAllWare();
        return productList;
    }

    @Override
    public WarehouseProduct findWareById(int pid) {
        WarehouseProduct ware = wareMapper.findWareById(pid);
        return ware;
    }

    @Override
    public int reduceWareStack(WarehouseProduct warehouseProduct) {
        int i = wareMapper.reduceWareStack(warehouseProduct);
        return i;
    }
}
